<?php

    require_once("includes/common.inc.php");
    require_once("includes/model/new_quizz.inc.php");

    $name = $_GET['name'];
    $type = $_GET['type'];

    if ( empty( $name ) )
    {
        echo "Invalid name";
        die;
    }

    $query = checkNameUniqueness($type, $name);

    if ( empty( $query ) )
    {
        echo "Available";
    }
    else
    {
        echo "Already exist";
    }

?>